#ifndef KEYBOARD_H
#define KEYBOARD_H

#include <QObject>
#include <QWidget>
#include <QButtonGroup>
#include <QPushButton>
#include <QHBoxLayout>
class Keyboard : public QObject
{
    Q_OBJECT
public:
    explicit Keyboard(QObject *parent = 0);
    QWidget* basicKeyboard();
    QButtonGroup* basicKeyboardButtongroup();
    QWidget* scientificKeyboard();
    QButtonGroup* scientificKeyboardButtongroup();
    QWidget* programKeyboard();
    QButtonGroup* programKeyboardButtongroup();
    QWidget* statisticsKeyboard();
    QButtonGroup* statisticsKeyboardButtongroup();
    QPushButton* braceCounterButton();

signals:
    void degreesClicked();
    void radiansClicked();
    void gradsClicked();
    void openBraceClicked();
    void closeBraceClicked();
    void hexClicked();
    void decClicked();
    void octClicked();
    void binClicked();
    void qwordClicked();
    void dwordClicked();
    void wordClicked();
    void byteClicked();
    void hexButtonClicked(QAbstractButton* button);

public slots:
    void handleInvClicked();
    void setBraceCounterText(QString);
    void radixButtonClicked(QAbstractButton* button);
    void handleHexButtons(bool checked);
    void handleOctButtons(bool checked);
    void handleBinButtons(bool checked);
    void enableAllButtons();
   // void handleDecButtons(bool checked);

private:
    QHBoxLayout* createButtonRow(QString buttonTexts,QButtonGroup* buttonGroup);
    QVBoxLayout* createButtonColumn(QString buttonTexts,QButtonGroup* buttonGroup,bool isRadioButton=false);
    QPushButton* createButton(QString buttonText,QWidget* parent = 0);
    QWidget* mBasicKeyboard;
    QWidget* mScientificKeyboard;
    QWidget* mPogramKeyboard;
    QWidget* mStatisticsKeyboard;
    QButtonGroup* mBasicKeyboardButtongroup;
    QButtonGroup* mScientificKeyboardButtongroup;
    QButtonGroup* mProgramKeyboardButtongroup;
    QButtonGroup* mStatisticsKeyboardButtongroup;
    QButtonGroup* mHexButtonGroup;
    QButtonGroup* mRadixButtonGroup;
    QPushButton* mInvButton;
    QPushButton* mBraceCounterButton;
    bool invert;
};

#endif // KEYBOARD_H
